{
  "properties" : { },
  "id" : "d1e0dac5d10240a68157ec3c7e950236",
  "script" : null,
  "groupId" : "e6cd7933a0e746b8b4af97af80c9c45c",
  "name" : "删除",
  "createTime" : 1728702394507,
  "updateTime" : 1728355336183,
  "lock" : null,
  "createBy" : null,
  "updateBy" : null,
  "path" : "/delete",
  "method" : "POST",
  "parameters" : [ ],
  "options" : [ ],
  "requestBody" : "",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : null,
  "description" : null,
  "requestBodyDefinition" : null,
  "responseBodyDefinition" : null
}
================================
import log

// 表名
var tn = body.tn
var ids = body.ids
var idarr = String.valueOf(ids).split(",")
// 判断是否可以删除
var isDel = 0
if (isDel>0){
    exit 1, "不能删除";
}

var tx = db.transaction()
try {
    // 执行删除
    db.table(tn).where().in("id",idarr).delete()
    tx.commit()
} catch(e) {
    var msg = "删除失败"
    tx.rollback()
    log.error(msg.concat(":{}"),e)
    exit 1, msg;
}

exit 0, "删除成功";